package cn.eastseven.netserver;

import org.apache.mina.core.session.IoSession;
import org.apache.mina.filter.codec.ProtocolEncoder;
import org.apache.mina.filter.codec.ProtocolEncoderOutput;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

@Component
public class SimpleEncoder implements ProtocolEncoder {

	private static final Logger log = LoggerFactory.getLogger(SimpleEncoder.class);
	
	public void encode(IoSession session, Object message, ProtocolEncoderOutput out) throws Exception {
		log.debug("encode: sessionId={}, msg={}, protocolEncoderOutput={}", session.getId(), message, out);
	}

	public void dispose(IoSession session) throws Exception {
		log.debug("dispose: sessionId={}", session.getId());
	}

}
